home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 May: Tool Chest / Developer CD Series May 1996 (Tool Chest) (Apple Computer) (1996).iso / Sample Code / Http Server / -read me- next >
Encoding:
Text File  |  1996-01-11  |  4.2 KB  |  164 lines  |  [TEXT/CWIE]

  1. /*
  2. -----BEGIN PGP SIGNED MESSAGE-----
  3.  
  4. HttpServer Macintosh OpenTransport Network Server shell 
  5.  
  6. Version: early but functional
  7.  
  8. Apple Macintosh Developer Technical Support
  9. Written by:  Vinne Moscaritolo
  10.  
  11. Copyright (work in progress)  Apple Computer, Inc 
  12.  
  13. You may incorporate this sample code into your applications without
  14. restriction, though the sample code has been provided "AS IS" and the
  15. responsibility for its operation is 100% yours.  However, what you are
  16. not permitted to do is to redistribute the source as "DSC Sample Code"
  17. after having made changes. If you're going to re-distribute the source,
  18. we require that you make it clear in the source that the code was
  19. descended from Apple Sample Code, but that you've made changes.
  20.  
  21. HttpServer is a MacOS faceless background task that can be used as framework
  22. for developing connection based OpenTransport network servers. Written in 
  23. Metrowerks C++, the HttpServer utilizes the Thread Manager, OpenTransport, 
  24. AppleEvents (barely) and C++ IOStreams.
  25.  
  26. The current example will bind onto TCP port 80 (HTTP) and listen for incoming
  27. connection requests, It will then spawn the connetion to another thread which
  28.  
  29. can process it independantly.. To test, make sure your TCP/IP is up and
  30. running,
  31. then launch the app into the background and a access it with a web browser 
  32. (Netscape,Cyerdog or whatever) and it will return you a test page
  33. for example my test node was 17.203.21.76 so I entered int netscape..
  34.  
  35. http://17.203.21.76
  36.  
  37. and I got back.
  38.  
  39. - ------
  40. Vinnie's OpenTransport HTTP Test Server
  41.  
  42. Server Info:
  43. Name:            Mr Mojo Risin
  44. Date:            Fri, 12 Jan 1996 01:10:59 GMT
  45. Active Sessions: 1
  46. Free:            3
  47. Accepted:        0
  48. Rejected:        0
  49. Up Time:         0 min
  50. Client:          17.203.21.75 :1102
  51. StackSpace:      23036
  52.  
  53. Provider: 0
  54. Address:   17.203.21.76
  55. NetMask:   255.255.252.0
  56. Broadcast: 0.0.0.0
  57. Gateway:   17.203.20.1
  58. DNS:       17.203.21.76
  59. Domain:    apple.com
  60. Port 0
  61. Name:      serialA
  62. Bus:       Serial Devices
  63. Module:    serialAB
  64. Bus:       MthrBrd
  65. Flags:     TPI Can-Yield
  66. - ------
  67.  
  68.  
  69. Some of the techniques demonstrated in this sample are:
  70. - - Faceless Background Tasks
  71. - - Thread Manager
  72. - - OpenTransport connection management
  73. - - OpenTransport Async Notifer managemnt
  74. - - No-Copy network reads
  75. - - IOStreams managment
  76.  
  77.  
  78. There are a few key things that needs to be done 
  79. - - Properly handle XTL LISTEN/ACCEPT Handoff ( I know..this s what you all
  80. want)
  81. - - IOStream extraction support (means reading from the stream) and Thread
  82. suspend/resume
  83. - - more support for Transport independant I/O
  84.  
  85.  
  86. here is my detailed list..
  87.  
  88. main -
  89. - - notifier for error handler
  90.  
  91. TContext
  92. - - proper support for execptions
  93.  
  94. THTTServer
  95. - - remove uneccessary construct.destruct
  96. - - scan availablle providers to open on
  97. - - It wold be cool if THTTPSession::Run actally parsed html
  98.  
  99. TBackroundApp
  100. - - A start stop erver event would be cool
  101.  
  102. TNetworkAcceptor
  103. - - Listen/Accept and OTLook support
  104. - - Provideer will close event
  105. - - shutdown msg
  106. - - stream in prefs (TSessionPref)
  107. - - OptionManagement reuse IP ?
  108.  
  109. TNetworkSession
  110. - - timeout event/watchdog
  111. - - handle out of sequence TDATA befor TPASSCON
  112.  
  113. TNetworkStream
  114. - - write code for istream functions, support yield/suspend/resume thread
  115.  
  116. TNetworkEndpointDescriptor
  117. - - setup options
  118. - - adverstise service
  119. - - make compatible with future OT tranparent stuff (whatch this space, it will
  120. be cool)
  121. - - write TServicedescriptor
  122.  
  123. TAddrInet
  124. TAddr
  125. - - complete functionality
  126.  
  127. TGMT
  128. - - stream in date/time
  129.  
  130. - ---------------------------
  131.  
  132. I know that this code really requires some real documention but I wanted to
  133. make
  134. it available as soon as I can, I will periodicaly post updates on various
  135. places 
  136. on the net,  you can also contact me to find out where.
  137.  
  138. I was last able to compile it under CW7.
  139.  
  140. good luck
  141.  
  142. - -------------
  143. Vinnie Moscaritolo
  144. Apple DTS Sniper
  145. "One Shot..One Kill"
  146.  
  147. http://webstuff.apple.com/~vinnie/
  148.  
  149. Fingerprint =  4F A3 29 81 50 E4 04 F2  78 25 01 87 6E A2 14 6A
  150. - --------------
  151.  
  152. -----BEGIN PGP SIGNATURE-----
  153. Version: 2.6.2
  154.  
  155. iQCVAwUBMPW31/MF2+rAU+UdAQGX/AQAjvd4fN6guD2w3+FgCcLzrg2tWM2oNLiP
  156. Cbnq23EUo8K97k+F0QKdyqiWci4HPuTNtxYqZK2DPLkIylFuevMDgVcGTsZVbK/V
  157. PjrRwc1jUSRYMB61IRnbqJ/aiK7Huyp+WgwFnjk5oY03S7XwJV6HasDR2rz2Kxn7
  158. XVrq9fm9i+0=
  159. =rWY/
  160. -----END PGP SIGNATURE-----
  161.  
  162.  
  163.  
  164. */